package com.hckjsec.oa.service.impl;

import java.util.List;
import com.hckjsec.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hckjsec.oa.mapper.OaExpenseMapper;
import com.hckjsec.oa.domain.OaExpense;
import com.hckjsec.oa.service.IOaExpenseService;

/**
 * 公司OA报销Service业务层处理
 * 
 * @author cyt
 * @date 2022-01-06
 */
@Service
public class OaExpenseServiceImpl implements IOaExpenseService 
{
    @Autowired
    private OaExpenseMapper oaExpenseMapper;

    /**
     * 查询公司OA报销
     * 
     * @param id 公司OA报销ID
     * @return 公司OA报销
     */
    @Override
    public OaExpense selectOaExpenseById(Long id)
    {
        return oaExpenseMapper.selectOaExpenseById(id);
    }

    /**
     * 查询公司OA报销列表
     * 
     * @param oaExpense 公司OA报销
     * @return 公司OA报销
     */
    @Override
    public List<OaExpense> selectOaExpenseList(OaExpense oaExpense)
    {
        return oaExpenseMapper.selectOaExpenseList(oaExpense);
    }

    /**
     * 新增公司OA报销
     * 
     * @param oaExpense 公司OA报销
     * @return 结果
     */
    @Override
    public int insertOaExpense(OaExpense oaExpense)
    {
        oaExpense.setCreateTime(DateUtils.getNowDate());
        return oaExpenseMapper.insertOaExpense(oaExpense);
    }

    /**
     * 修改公司OA报销
     * 
     * @param oaExpense 公司OA报销
     * @return 结果
     */
    @Override
    public int updateOaExpense(OaExpense oaExpense)
    {
        oaExpense.setUpdateTime(DateUtils.getNowDate());
        return oaExpenseMapper.updateOaExpense(oaExpense);
    }

    /**
     * 批量删除公司OA报销
     * 
     * @param ids 需要删除的公司OA报销ID
     * @return 结果
     */
    @Override
    public int deleteOaExpenseByIds(Long[] ids)
    {
        return oaExpenseMapper.deleteOaExpenseByIds(ids);
    }

    /**
     * 删除公司OA报销信息
     * 
     * @param id 公司OA报销ID
     * @return 结果
     */
    @Override
    public int deleteOaExpenseById(Long id)
    {
        return oaExpenseMapper.deleteOaExpenseById(id);
    }
}
